package com.implementacion;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ibatis.dao.client.DaoException;
import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.ibatis.sqlmap.client.SqlMapExecutor;
import com.interfaces.IEmpresa;

public class DEmpresa extends SqlMapDaoTemplate implements IEmpresa {

    public DEmpresa(DaoManager daoManager) {
        super(daoManager);
    }

    public List listar() {
        List Lista = null;
        try{
        	SqlMapExecutor sqlMap = getSqlMapExecutor();
	        Map map = new HashMap();	
	        Lista = (List)sqlMap.queryForList("LISTA", map);  
	        System.out.println(Lista.size());
        }catch(SQLException e){		    
		    throw new DaoException("ERROR AL listar");
		}
        return Lista;
    }
}
